{include_core file="lib/header.html" title="提交订单"}
{include_core file="lib/top_nav.html"}
<div id="container" class="inner">
  <div class="crumbs"><a href="javascript:;">首页</a>&nbsp;&nbsp;/&nbsp;&nbsp;<a href="javascript:;">订单结算</a></div>
  <div class="order-state clearfix">
    <ul class="clearfix">
      <li class="li1 actived"><span class="icon1"><em>{if !$is_direct_buy}购物车{else}选择商品{/if}</em></span></li>
      <li class="li2 curr"><span class="icon2"><em>订单 </em></span></li>
      <li class="li3"><span class="icon3"><em>完成</em></span></li>
    </ul>
  </div>
  <div class="order-infor">
    <h1 class="title">填写并核对订单信息</h1>
    <ul class="order-infor-con js_orderUl js_addressParent" data-invoice_type="{$invoice_type}" data-invoice_title="{$invoice_title}" data-edit-paytype="{if $pay_type}0{else}1{/if}" data-edit-address="{if $address_info}0{else}1{/if}" data-address_id="{$address_info.id}" data-pay_type="{if $pay_type}{$pay_type}{else}1{/if}" {*data-express_id="{$express_id}" data-express_error="{$express_error}"*} data-invoice_title="{$invoice_title}">
      <li class="user-infor">
        <div class="user-infor-detail js_addressInfo {if !$address_info}hidden{/if}">
          <div class="order-infor-top clearfix"><h3 class="tit">收货人信息</h3><span class="prompt hidden">如需修改请先保存收货人信息</span><a href="javascript:void(0);" class="change-btn js_modifyAddress">[修改]</a></div>
          <p><span class="name">{$address_info.receiver}</span><span class="tel">{$address_info.mobile}</span></p>
          <p><span class="address">{$address_info.province} {$address_info.city} {$address_info.district}</span> <span class="address-detail">{$address_info.address}</span></p>
        </div>
        <div class="write-user-infor js_addressForm {if $address_info}hidden{/if}">
          <div class="order-infor-top clearfix"><h3 class="tit">收货人信息</h3><a href="javascript:;" class="save">保存收货人信息</a></div>
          <ul class="sel-address pay-type js_addressList">
            {foreach $address_list as $k=>$v}
            <li class="js_addressEdit {if $v.is_default}curr{/if}" data-address_id="{$v.id}"><label><i class="radio-bg {if $v.is_default}checked{/if}"></i><input type="radio js_sltAddress" value="{$v.id}" class="radio1" {if $v.is_default}checked{/if} />{$v.province} {$v.city} {$v.district} {$v.address} ({$v.receiver} 收) {$v.mobile}</label><span data-type="child" data-address_id="{$v.id}">编辑</span><span class="js_deleteAddress" data-address_id="{$v.id}">删除</span></li>
            {/foreach}
            <li class="js_addressAdd {if !$address_info}curr{/if}" data-address_id="new"><label><i class="radio-bg {if !$address_info}checked{/if}"></i><input type="radio" class="radio1 js_sltAddress" value="new" {if !$address_info}checked{/if}/>使用新地址</label></li>
            <input type="hidden" class="js_sltAddressInp" value="{if $address_info}{$address_info.id}{else}new{/if}"/>
          </ul>
          <!--<a href="javascript:;" class="use-new-address">使用新地址</a>-->
          <style>
            .sel-address span{ cursor: pointer; }
          </style>
          <div class="input-box">
            <div class="js_addressFormDiv {if $address_info}hidden{/if}">
              <p class="clearfix"><span class="name">收 货 人：</span><span class="txt-box"><input type="text" value="{$address_info.receiver}" class="txt1 js_ADDReceiver"/></span></p>
              <p class="clearfix" id="addressSlt">
                <span class="name">详细地址：</span>
                <span class="sel-box">
                  <span class="sel-wrap">
                    <select class="sel js_ADDProv" id="prov">
                      <option value="0">省份/直辖市</option>
                    </select>
                    <a href="javascript:void(0);" class="up"></a>
                    <a href="javascript:void(0);" class="down"></a>
                  </span>
                  <span class="sel-wrap">
                    <select class="sel js_ADDCity" id="city">
                      <option value="0">城市</option>
                    </select>
                    <a href="javascript:void(0);" class="up"></a>
                    <a href="javascript:void(0);" class="down"></a>
                  </span>
                  <span class="sel-wrap">
                    <select class="sel js_ADDDist" id="dist">
                      <option value="0">区/县</option>
                    </select>
                    <a href="javascript:void(0);" class="up"></a>
                    <a href="javascript:void(0);" class="down"></a>
                  </span>
                </span>
              </p>
              <input type="hidden" id="pre_province" value="{$address_info.province_id}"/>
              <input type="hidden" id="pre_city" value="{$address_info.city_id}"/>
              <input type="hidden" id="pre_district" value="{$address_info.district_id}"/>
              <p class="clearfix"><span class="name">详细地址：</span><span class="txt-box"><input type="text" value="{$address_info.address}" class="txt1 txt2 js_ADDAddress"/></span></p>
              <p class="clearfix"><span class="name">手      机：</span><span class="txt-box"><input type="text" value="{$address_info.mobile}" class="txt1 js_ADDMobile"/></span><span class="name name2">或 固定电话：</span><span class="txt-box"><input type="text" value="{$address_info.tel}" class="txt1 js_ADDTel"/></span></p>
              <p><label class="label1"><span class="check-wrap js_ADDIsDefault {if $address_info}checked{/if}"><input type="checkbox" class="chechbox1"/></span>设为默认地址</label></p>
            </div>
            <p><a href="javascript:void(0);" class="btn2 save-btn js_ADDSave">保存</a></p>
            <!-- <span class="prompt"><i class="false-icon"></i></span> -->
          </div>
        </div>
        <!--end write-user-infor-->
      </li>
      
      <!-- 支付方式 -->
      <li>
        <div class="pay-send1 js_tmpPayDiv {if $address_info}hidden{/if}">
          <div class="order-infor-top clearfix"><h3 class="tit">支付方式 </h3><span class="prompt">如需修改请先保存收货人信息</span></div>
        </div>
        <div class="pay-send2 js_tmpSltDiv {if $pay_type || !$address_info}hidden{/if}">
          <div class="order-infor-top clearfix"><h3 class="tit">支付方式 </h3><a href="javascript:;" class="save">保存支付方式</a></div>
          <ul class="pay-type js_payList" data-pay_type="{$pay_type}">
            {$pay_type_list = openapi_config::$pay_type}
            {foreach $pay_type_list as $k=>$v}
            <li {if $k == $pay_type}class="curr"{/if} data-pay_type="{$k}"><label><i class="radio-bg {if $k == $pay_type}checked{/if}"></i><input type="radio" class="radio1 js_orderPayTypeInput" {if $k == $pay_type}checked{/if} value="{$v.title}"/>{$v.title}支付</label><span class="explain">{$v.dis}</span></li>
            {/foreach}
          </ul>
          <a href="javascript:void(0);" class="save-btn js_savePayType">保存</a>
        </div>
        <div class="pay-send-detail js_payInfo {if !$pay_type || !$address_info}hidden{/if}">
          <div class="order-infor-top clearfix"><h3 class="tit">支付方式</h3><span class="prompt hidden">如需修改请先保存收货人信息</span><a href="javascript:void(0);" class="change-btn js_modifyPayType">[修改]</a></div>
          <p><span class="js_orderPayType">{openapi_config::$pay_type[$pay_type]['title']}支付</span></p>
        </div>
      </li>

      {*
      <!-- 支付及配送方式 -->
      <li>
        <div class="pay-send1 js_tmpPayDiv {if $address_info}hidden{/if}">
          <div class="order-infor-top clearfix"><h3 class="tit">支付及配送方式 </h3><span class="prompt">如需修改请先保存收货人信息</span></div>
        </div>
        <div class="pay-send2 js_tmpSltDiv {if $pay_type || !$address_info}hidden{/if}">
          <div class="order-infor-top clearfix"><h3 class="tit">支付方式 </h3><a href="javascript:;" class="save">保存支付及配送方式</a></div>
          <ul class="pay-type js_payList" data-pay_type="{$pay_type}">
            {$pay_type_list = openapi_config::$pay_type}
            {foreach $pay_type_list as $k=>$v}
            <li {if $k == $pay_type}class="curr"{/if} data-pay_type="{$k}"><label><i class="radio-bg {if $k == $pay_type}checked{/if}"></i><input type="radio" class="radio1 js_orderPayTypeInput" {if $k == $pay_type}checked{/if} value="{$v.title}"/>{$v.title}支付</label><span class="explain">{$v.dis}</span></li>
            {/foreach}
          </ul>
          <div class="order-infor-top clearfix" style="margin-top: 10px;"><h3 class="tit">配送方式 </h3></div>
          <ul class="pay-type js_expressList" data-express_id="{$express_id}" data-express_title="{$express_title}">
            {foreach $express_list as $k=>$v}
            <li {if $v.id == $express_id}class="curr"{/if} data-express_id="{$v.id}" data-express_title="{$v.title}"><label><i class="radio-bg {if $v.id == $express_id}checked{/if}"></i><input type="radio" class="radio1 js_orderExpressInput" {if $v.id == $express_id}checked{/if} value="{$v.title}"/>{$v.title}</label><span class="explain"></span></li>
            {/foreach}
          </ul>
          <a href="javascript:void(0);" class="save-btn js_savePayType">保存</a>
        </div>
        <div class="pay-send-detail js_payInfo {if !$pay_type || !$address_info}hidden{/if}">
          <div class="order-infor-top clearfix"><h3 class="tit">支付及配送方式</h3><span class="prompt hidden">如需修改请先保存收货人信息</span><a href="javascript:void(0);" class="change-btn js_modifyPayType">[修改]</a></div>
          <p><span class="js_orderPayType">{openapi_config::$pay_type[$pay_type]['title']}支付</span></p>
          <p><span class="js_expressTitle">{$express_title}</span><span>中小件商品</span><span class="red">预计 {$sentTime}  送达</span></p>
        </div>
      </li>*}
      <!-- 发票 -->
      <li>
        <div class="invoice">
          <div class="order-infor-top clearfix"><h3 class="tit">发票信息</h3></div>
          <div class="radio-box js_invoiceList" style="height: 30px;line-height: 30px;">
            {* <label data-type="0"><i class="radio-bg {if !$invoice_type}checked{/if}"></i><input type="radio" class="radio1" {if !$invoice_type}checked{/if}/>不开发票</label> *}
            <label data-type="1"><i class="radio-bg {if $invoice_type == 1}checked{/if}"></i><input type="radio" class="radio1" {if $invoice_type == 1}checked{/if} />电子发票</label>
            <label data-type="2"><i class="radio-bg {if $invoice_type == 2}checked{/if}"></i><input type="radio" class="radio1" {if $invoice_type == 2}checked{/if} />增值税普通发票</label>
            <input type="text" value="{$invoice_title}" placeholder="发票抬头" class="txt1 js_invoiceInput {if $invoice_type != 2}hidden{/if}"/>
          </div>
        </div>
        <!--end invoice1-->
      </li>
    </ul>
    <!--end order-infor-con-->
    <div class="goods-coupons">
      <div class="order-infor-top clearfix"><h3 class="tit">确认商品及优惠券</h3></div>
      <table class="tab-product-order">
        <tr class="head">
          <td class="td1"><span>商品名称</span></td>
          <td class="td2"><span>单品价格</span></td>
          <td class="td3"><span>购买数量</span></td>
          <td class="td4" style="padding-right: 10px;"><span>小计</span></td>
        </tr>
        <script type="text/javascript">
          s.products="";
        </script>
        {foreach $cart_list as $k=>$v}
        {$property_info = goods_helper::get_sku_property_value($v.sku_id)}
        <tr>
          <td>
            <span class="product-img"><img src="{_image($v.goods_cover)}" width="100"></span>
            <span class="name">{$v.goods_title} {if $property_info}<span style="color:#AAA">{$property_info}</span> {/if}{if $v.is_promotion == 1}<span style="background:#c7070d; line-height:13px; padding: 3px 6px 3px; font-size:13px;color:#FFF;border-radius:3px;">加价购</span>{/if}
              {if $v.gift_detail}
              {foreach $v.gift_detail as $g_k=>$g_v}
              <p class="gift">【赠品】 {$g_v.goods_title} X <em>{$g_v.goods_num}</em></p>
              {/foreach}
              {/if}
            </span>
          </td>
          <td>{$v.goods_price}元</td>
          <td>{$v.goods_num}</td>
          <td>{if $v.is_gift >0}0.00{else}{number_format($v.goods_num*$v.goods_price, 2)}元{/if}</td>
        </tr>
        <script type="text/javascript">
          s.products+=";{$v.goods_id},";
        </script>
        {/foreach}
      </table>
      <div class="bottom clearfix" style="height: 223px;">
        <div class="coupons-box">
          <div class="head curr js_useCoupon">
            <label><span class="check-wrap" data-diy="1"><input type="checkbox" class="chechbox1" /></span>使用优惠券</label>
          </div>
          <div class="my-coupons js_couponInfo hidden">
            <div class="coupons-nav"><a href="javascript:void(0);" class="curr">填写优惠券码</a><a href="javascript:void(0);">查看我的优惠券</a></div>
            <ul class="tab-coupons">
              <li class="curr">
                <p><input type="text" class="txt1 focus"/></p>
                <span class="prompt">优惠券码不正确！</span>
                <p class="btns clearfix"><a href="javascript:void(0);" class="cancel js_couponCancel"> 取消</a><a href="javascript:void(0);" class="confirm js_couponSave">确认</a></p>
              </li>
              <li>
                <p class="no">没有优惠券可以选择</p>
              </li>
            </ul>
          </div>
        </div>
        <div class="total">
          <ul>
            <li><span class="name">商品件数：</span><span class="num">{$cart_num}件</span></li>
            <li><span class="name">金额合计：</span><span class="num">{$total_price_format}元</span></li>
            <li><span class="name">活动优惠：</span><span class="num">{if $promotion_info}-{number_format($promotion_info.offer_price, 2)}{else}0{/if}元</span></li>
            <li><span class="name">优惠券抵扣：</span><span class="num js_couponSubPrice">0元</span></li>
            <li><span class="name">运费：</span><span class="num js_expressTotalPrice">0元</span></li>
          </ul>
          <p class="sum"><span class="name">商品总计：</span><span class="num"><em class="js_orderCountPrice" data-order_price="{$total_price_discount_format}">{$total_price_discount_format}</em>元</span></p>
        </div>
      </div>
      <div class="coupons-btns">
        <p class="btns">
          {if !$is_direct_buy}
            <a href="{AnUrl('cart')}" class="back-buy-car">返回购物车</a>
          {/if}
          <a href="javascript:void(0);" class="pay-btn js_subOrder" id="baiduTjBtnPay">去付款</a>
        </p>
      </div>
      <form action="{AnUrl('order/pay')}" id="js_orderForm" method="post" target="_blank">
        {if $is_direct_buy}
          <input type="hidden" name="sku_id" value="{$direct_sku_info.id}"/>
          <input type="hidden" name="num" value="{$direct_buy_num}"/>
        {/if}
        <input type="hidden" name="address"/>
        <input type="hidden" name="invoice_type"/>
        <input type="hidden" name="invoice_title"/>
        <input type="hidden" name="pay_type"/>
        <input type="hidden" name="coupon_code"/>
        <input type="hidden" name="express_id"/>
      </form>
    </div>
    <!--end goods-coupons-->

  </div>
  <!--end order-infor-->
</div>
<!--end container-->

<!-- <div class="float-pay hidden js_orderPayEnd" style="position: fixed;">
  <div class="top clearfix"><h2>订单支付…</h2><a href="{AnUrl('order')}" class="close"></a></div>
  <div class="con clearfix">
    <span class="img-box"><img src="{$smarty.const.SITE_URL}/images/people1.png" width="238" height="236"></span>
    <div class="con-right">
      <h2 class="tit">支付失败？</h2>
      <p>额度问题，推荐<span class="red">支付宝快捷支付&gt;</span></p>
      <p>其他问题，查看<span class="red">支付常见问题&gt;</span></p>
      <p class="btn-box"><a href="{AnUrl('order')}" class="btn">我已完成支付</a></p>
      <p>立即查看<a href="{AnUrl('order')}" class="look">查看订单详情&gt;</a></p>
    </div>
  </div>
</div> -->
<div class="black-shade hidden"></div>
<div class="float-pay-look hidden js_orderPayEnd">
  <a href="{AnUrl('order')}" class="close"></a>
  <h3>订单支付…</h3>
  <h4>请在新开网银页面完成付款后选择：</h4>
  <p><i class="pay-ok"></i>付款成功&nbsp;&nbsp;|&nbsp;&nbsp;<span class="span1">立即查看<a href="{AnUrl('order')}">订单详情></a></span></p>
  <p><i class="pay-false"></i>付款失败&nbsp;&nbsp;|&nbsp;&nbsp;<span class="span1">额度问题，推荐<a href="javascript:;">支付宝快捷支付 </a>&nbsp;&nbsp;&nbsp;&nbsp;其他问题，查看<a href="https://cshall.alipay.com/lab/help_detail.htm?help_id=258086">支付常见问题></a></span></p>
</div>

<script language="JavaScript" type="text/javascript"><!--
/* You may give each page an identifying name, server, and channel on
the next lines. */
s.pageName="Nbd:购物流程:填写订单";
s.server=""
s.channel="Nbd"
s.pageType=""
s.prop1="Nbd:购物流程";
s.prop2="Nbd:购物流程:填写订单";
s.prop3="Nbd:购物流程:填写订单";
s.prop4="Nbd:购物流程:填写订单";
/* Conversion Variables */
s.campaign=""
s.state=""
s.zip=""
s.events="scCheckout";
s.purchaseID=""
s.eVar1=""
s.eVar2=""
s.eVar3=""
s.eVar4=""
s.eVar5=""
/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/
var s_code=s.t();if(s_code)document.write(s_code)//--></script>
<script language="JavaScript" type="text/javascript"><!--
if(navigator.appVersion.indexOf('MSIE')>=0)document.write(unescape('%3C')+'\!-'+'-')
//--></script><noscript><img src="http://lenovochina.122.2o7.net/b/ss/lenovo-nbd-prd/1/H.26.2--NS/0"
height="1" width="1" border="0" alt="" /></noscript><!--/DO NOT REMOVE/-->
<!-- End SiteCatalyst code version: H.26.2. -->
{load_js file="address/AjaxAddress.js"}
{load_js file="app/address.js?time={time()}"}
{load_js file="app/order.js?time={time()}"}
{include_core file="lib/footer.html"}